home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 30
/
Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso
/
Aminet
/
misc
/
math
/
MathFX_src.lha
/
fxhrsh.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-12-20
|
1KB
|
52 lines
/* Writes the Hershey symbol "ch" centred at the physical */
/* coordinate (x,y) */
#include "mathfx.h"
void fxhrsh(ch,x,y)
int ch, x, y;
{
int cx, cy, k, penup;
short int xygrid[300];
float symdef, symht, scale, xscale, yscale, xpmm, ypmm;
gsym(&symdef,&symht);
gpixmm(&xpmm,&ypmm);
k = 5;
penup = 1;
scale = 0.05 * symht;
if (!fxcvec(ch,xygrid)) {
movphy(x,y);
return;
}
/* Compute how many physical pixels correspond to a character pixel */
xscale = scale * xpmm;
yscale = scale * ypmm;
for(;;) {
cx = xygrid[k];
k = k+1;
cy = xygrid[k];
k = k+1;
if (cx == -64 && cy == -64) {
movphy(x,y);
return;
}
else if (cx == -64 && cy == 0)
penup = 1;
else {
if (penup != 0) {
movphy(round(x+xscale*cx),round(y+yscale*cy));
penup = 0;
}
else
draphy(round(x+xscale*cx),round(y+yscale*cy));
}
}
}